import numpy as np
import utils
"""
Basic neural network, define necessary methods and attributes.
"""


class Cell:
    def __init__(self, weight_init=1, bias=0, inputs_shape=1):
        self.inputs = None
        self.inputs_shape = inputs_shape
        self.weight = utils.Tensor(np.full(self.inputs_shape, weight_init))
        self.bias = utils.Tensor(np.full(1, bias))

    def __call__(self, inputs):
        if isinstance(inputs, utils.Tensor):
            self.inputs = inputs
        else:
            self.inputs = utils.Tensor(inputs)
        return self.inputs.dot(self.weight)
